#ifndef SPATIALINDEX_H
#define SPATIALINDEX_H
#include"cellforindex.h"
#include<QVector>
#include"geomap.h"
//空间索引基类
enum indexType {QUADTREE,GRID};

class spatialIndex
{
public:
    geoMap *map;
    spatialIndex();
    virtual ~spatialIndex();
    virtual bool initialize(double minX,double maxX,double minY,double maxY,geoMap *map)=0;
    virtual QVector<cellForIndex* > getPaintCells()=0;//获取绘图网格
    indexType type;
    QVector<cellForIndex*> leafCells;//叶子网格(一维排列），只有叶子网格才真正存储空间物体，一维排列方便通用形式的接口调用
    QVector<cellForIndex* > getLeafCells();
    bool isInitialized;
};

#endif // SPATIALINDEX_H
